package com.jain.webcore.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Servlet implementation class BaseServlet
 */
public abstract class BaseServlet extends HttpServlet {
    /**
     * Do response.
     *
     * @param response the response
     * @param result   the result
     */
    protected void doResponse(HttpServletResponse response, String result) {
        try {
            PrintWriter out = response.getWriter();
            out.write(result);
            out.flush();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
